//
//  UserInfo.m
//  Baymax
//
//  Created by jolin on 16/4/20.
//  Copyright © 2016年 jolin. All rights reserved.
//

#import "UserInfo.h"

@implementation UserInfo

/**
 *  初始化方法
 *
 *  @param dic 属性字典
 *
 *  @return 实例对象
 */
- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        self.username = dic[@"username"];
        self.nickname = dic[@"nickname"];
        self.phone = dic[@"phone"];
        self.password = dic[@"password"];
        self.photo = dic[@"photo"];
        self.photo_base64 = dic[@"photo_base64"];
        self.email = dic[@"email"];
        self.sex = dic[@"sex"];
        self.token = dic[@"token"];
        self.allow_add_friend = [dic[@"allow_add_firend"] boolValue];
        self.links_self = dic[@"links_self"];
        self.allow_add_friend = dic[@"allow_add_firend"];
    }
    return self;
}

+ (instancetype)userInfoWithDic:(NSDictionary *)dic {
    return [[self alloc] initWithDic:dic];
}


@end
